package com.help10000.rms.ui.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter

class MainFragmentAdapter(
    fragmentManager: FragmentManager,
    fragments: MutableList<Fragment>,
    title: MutableList<String>
) : FragmentPagerAdapter(fragmentManager, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) {
    var fragments = mutableListOf<Fragment>()
    var titles = mutableListOf<String>()

    init {
        this.fragments = fragments
        this.titles = title
    }

    override fun getCount(): Int {

        return fragments.size
    }

    override fun getItem(position: Int): Fragment {

        return fragments[position]
    }

    override fun getPageTitle(position: Int): CharSequence? {
        return titles[position]
    }
}